home *** CD-ROM | disk | FTP | other *** search
/ Aminet 8 / Aminet 8 (1995)(GTI - Schatztruhe)[!][Oct 1995].iso / Aminet / comm / term / trms20e.lha / ScriptFiles.lha / host.scp < prev    next >
Text File  |  1995-01-28  |  3KB  |  127 lines

  1. /* $VER: Terminus 2.0 - host.scp (03.07.93) */
  2.  
  3. /*
  4. **    This is *not* a complete script!
  5. **
  6. **    Currently, this script handles the login sequence of a caller.
  7. ** I had hoped to finish this before release, but never found the time.
  8. ** If someone would like to "adopt" this script please contact me.
  9. **
  10. */
  11.  
  12.    cls
  13.    print local "Terminus Host script"
  14.    gosub get_user   
  15.    end
  16.  
  17. get_user:
  18.    close #1
  19.    print
  20.    input "First name: ", firstname$
  21.    input " Last name: ", lastname$
  22.  
  23.    firstname$ = trim$(upper$(firstname$))
  24.    lastname$ = trim$(upper$(lastname$))
  25.  
  26.    if exists("terminus:host.users")
  27.       open input 1, "terminus:host.users"
  28.    else
  29.       goto reenter_city
  30.    endif
  31.  
  32. find_user_loop:
  33.    read #1, user_firstname$
  34.  
  35.    if user_firstname$ == "END_OF_FILE" 
  36.       close #1
  37.       print
  38.       ask "Name not found, [R]eenter or [C]ontinue? ", a$
  39.       print
  40.       a$ = trim$(upper$(a$))
  41.  
  42.       if a$ == "R"
  43.          goto get_user
  44.       endif
  45.  
  46. reenter_city:
  47.       input "      City: ", city$
  48.       city$ = trim$(upper$(city$))
  49.  
  50.       if not len(city$)
  51.          print "Please enter the city you're from..."
  52.          goto reenter_city
  53.       endif
  54.  
  55. reenter_state:
  56.       input "     State: ", state$
  57.       state$ = trim$(upper$(state$))
  58.  
  59.       if not len(state$)
  60.          print "Please enter the state you're from..."
  61.          goto reenter_state
  62.       endif
  63.  
  64. reenter_password:
  65.       input quiet "Enter password to use on this system: ", password$
  66.       password$ = trim$(upper$(password$))
  67.  
  68.       if not len(password$)
  69.          print "You MUST enter a password for use on this system!"
  70.          goto reenter_password
  71.       endif
  72.  
  73.       input quiet "Reenter password to verify: ", user_password$
  74.       user_password$ = trim$(upper$(user_password$))
  75.       
  76.       if password$ != user_password$
  77.          goto reenter_password 
  78.       endif
  79.  
  80.       user_security = 10
  81.       gosub add_user
  82.       goto hello
  83.    else
  84.       read #1, user_lastname$, user_city$, user_state$, user_password$, user_security
  85.  
  86.       if user_firstname$ == firstname$
  87.          if user_lastname$ == lastname$
  88.             print "From "; user_city$; ","; user_state$;
  89.             ask " [Y]/n? ", i$
  90.             print
  91.             if trim$(upper$(i$)) == "N"
  92.                goto get_user
  93.             else
  94.                i = 1
  95. password_loop:
  96.                input quiet "  Password: ", password$
  97.                password$ = trim$(upper$(password$))
  98.  
  99.                if user_password$ != password$
  100.                   if i == 3
  101.                      print "Password attempts exceeded, goodbye."
  102.                      goto done
  103.                   endif
  104.  
  105.                   i = i + 1
  106.                   goto password_loop
  107.                endif
  108. hello:
  109.                print "Welcome "; firstname$; " "; lastname$; " to the Terminus Host!"
  110.                print "Your current security level is: "; user_security
  111.                goto done
  112.             endif
  113.          endif
  114.       endif
  115.    endif
  116.    goto find_user_loop               
  117.    
  118. done:
  119.    close #1
  120.    return
  121.       
  122. add_user:                          
  123.    open append 1, "terminus:host.users"
  124.    write #1, firstname$, lastname$, city$, state$, password$, user_security
  125.    close #1
  126.    return
  127.